#include "asm.h"
#include "regdef.h"
#include "inst_test.h"

LEAF(n18_bl_test)
    
    addi.w s0, s0 ,1
    li  s2, 0x0
###test inst
    TEST_BL(0x8c3e1efa, 0xeb2bd57c, 0x8c3e1efa, 0xeb2bd57c)
    TEST_BL(0xfbc1f5d0, 0xb91bc0b0, 0xfbc1f5d0, 0xb91bc0b0)
    TEST_BL(0xc1062356, 0xf8d60c60, 0xc1062356, 0xf8d60c60)
    TEST_BL(0x0b2dc8e4, 0xff276d2f, 0x0b2dc8e4, 0xff276d2f)
    TEST_BL(0x312fabd9, 0x970387ac, 0x312fabd9, 0x970387ac)
    TEST_BL(0x46360a68, 0xf903f5cd, 0x46360a68, 0xf903f5cd)
    TEST_BL(0x41cc660a, 0x52295cdc, 0x41cc660a, 0x52295cdc)
    TEST_BL(0x48fa3a04, 0x69636126, 0x48fa3a04, 0x69636126)
    TEST_BL(0xbcd7cfec, 0x779a95ec, 0xbcd7cfec, 0x779a95ec)
    TEST_BL(0x5fc96388, 0xc43c4580, 0x5fc96388, 0xc43c4580)
    TEST_BL(0x2e6acb2a, 0x3ff930e4, 0x2e6acb2a, 0x3ff930e4)
    TEST_BL(0x570165c0, 0x984bd878, 0x570165c0, 0x984bd878)
    TEST_BL(0x881d5800, 0x034e6000, 0x881d5800, 0x034e6000)
    TEST_BL(0x8a5b3be0, 0xb94b6376, 0x8a5b3be0, 0xb94b6376)
    TEST_BL(0x8b75ce52, 0x13b7a780, 0x8b75ce52, 0x13b7a780)
    TEST_BL(0xfcdb1218, 0xff483538, 0xfcdb1218, 0xff483538)
    TEST_BL(0x2e450deb, 0x10609f0c, 0x2e450deb, 0x10609f0c)
    TEST_BL(0x3e80cb3e, 0xc960e400, 0x3e80cb3e, 0xc960e400)
    TEST_BL(0x44af9ce0, 0x800d3820, 0x44af9ce0, 0x800d3820)
    TEST_BL(0x08eec534, 0xb7735884, 0x08eec534, 0xb7735884)
    TEST_BL(0xbc5a66a4, 0xdf144ab4, 0xbc5a66a4, 0xdf144ab4)
    TEST_BL(0x2aeb3f3c, 0xedcc9ce0, 0x2aeb3f3c, 0xedcc9ce0)
    TEST_BL(0xcd784df5, 0xaff92f84, 0xcd784df5, 0xaff92f84)
    TEST_BL(0xa34d260a, 0xb77c87f4, 0xa34d260a, 0xb77c87f4)
    TEST_BL(0xa0d86880, 0xafeba4e4, 0xa0d86880, 0xafeba4e4)
    TEST_BL(0xf7b8f37b, 0x911de040, 0xf7b8f37b, 0x911de040)
    TEST_BL(0x7c777a50, 0xe14e1a90, 0x7c777a50, 0xe14e1a90)
    TEST_BL(0x7b1a2aa1, 0x944c4918, 0x7b1a2aa1, 0x944c4918)
    TEST_BL(0x7e86eb59, 0xb5428b4c, 0x7e86eb59, 0xb5428b4c)
    TEST_BL(0x7bf88eb0, 0x7730b200, 0x7bf88eb0, 0x7730b200)
    TEST_BL(0x68e11960, 0x8bb65900, 0x68e11960, 0x8bb65900)
    TEST_BL(0x761df4e4, 0xa9cb4b94, 0x761df4e4, 0xa9cb4b94)
    TEST_BL(0xcf09190a, 0x38d5a080, 0xcf09190a, 0x38d5a080)
    TEST_BL(0xe30a8d18, 0xc20c3730, 0xe30a8d18, 0xc20c3730)
    TEST_BL(0xed6878d8, 0xf351a7d0, 0xed6878d8, 0xf351a7d0)
    TEST_BL(0x2ce27912, 0xe112dcc0, 0x2ce27912, 0xe112dcc0)
    TEST_BL(0xcf2e7144, 0x35530400, 0xcf2e7144, 0x35530400)
    TEST_BL(0xc7819b20, 0x8274cb2e, 0xc7819b20, 0x8274cb2e)
    TEST_BL(0xc1799706, 0x493e5d5c, 0xc1799706, 0x493e5d5c)
    TEST_BL(0xd28b3668, 0xdb280f90, 0xd28b3668, 0xdb280f90)
    TEST_BL(0x026aa762, 0x3e6cae50, 0x026aa762, 0x3e6cae50)
    TEST_BL(0x66ef8290, 0x649f12da, 0x66ef8290, 0x649f12da)
    TEST_BL(0x62b6f780, 0x3a972800, 0x62b6f780, 0x3a972800)
    TEST_BL(0xc820cfb0, 0xfb4f92d6, 0xc820cfb0, 0xfb4f92d6)
    TEST_BL(0xafb11450, 0x6f3f4ac4, 0xafb11450, 0x6f3f4ac4)
    TEST_BL(0x4f07fcf0, 0xc90ed8f2, 0x4f07fcf0, 0xc90ed8f2)
    TEST_BL(0x348bcc32, 0xaf14d88e, 0x348bcc32, 0xaf14d88e)
    TEST_BL(0xac0d1b82, 0x859c9fa0, 0xac0d1b82, 0x859c9fa0)
    TEST_BL(0x2967a800, 0x9be679e0, 0x2967a800, 0x9be679e0)
    TEST_BL(0x54682b9b, 0xf6afc130, 0x54682b9b, 0xf6afc130)
    TEST_BL(0x546c98f0, 0x54bb0a06, 0x546c98f0, 0x54bb0a06)
    TEST_BL(0x0b51bf3f, 0x31c22efc, 0x0b51bf3f, 0x31c22efc)
    TEST_BL(0x04ad485a, 0x39e85f59, 0x04ad485a, 0x39e85f59)
    TEST_BL(0xe7e576d8, 0x68ca0df9, 0xe7e576d8, 0x68ca0df9)
    TEST_BL(0xba12c92e, 0x85577d42, 0xba12c92e, 0x85577d42)
    TEST_BL(0x403b4458, 0x6becb754, 0x403b4458, 0x6becb754)
    TEST_BL(0x8f6d6b48, 0xe1563e28, 0x8f6d6b48, 0xe1563e28)
    TEST_BL(0xb41d3203, 0x96329e80, 0xb41d3203, 0x96329e80)
    TEST_BL(0xe6aec8cb, 0x27ef5f5b, 0xe6aec8cb, 0x27ef5f5b)
    TEST_BL(0x5eedde10, 0x94eb3844, 0x5eedde10, 0x94eb3844)
    TEST_BL(0x83b08836, 0x22173eb0, 0x83b08836, 0x22173eb0)
    TEST_BL(0x59931aae, 0xdbc9d400, 0x59931aae, 0xdbc9d400)
    TEST_BL(0x062253c0, 0x2628a368, 0x062253c0, 0x2628a368)
    TEST_BL(0xb4f84c50, 0xd5d39399, 0xb4f84c50, 0xd5d39399)
    TEST_BL(0xeb44ae38, 0xdc7d3918, 0xeb44ae38, 0xdc7d3918)
    TEST_BL(0x53335424, 0x9eeec7c0, 0x53335424, 0x9eeec7c0)
    TEST_BL(0x0cb4fb1c, 0x5d38a700, 0x0cb4fb1c, 0x5d38a700)
    TEST_BL(0x94074b4a, 0x19de1db2, 0x94074b4a, 0x19de1db2)
    TEST_BL(0x47bfb4b8, 0x48c0ff80, 0x47bfb4b8, 0x48c0ff80)
    TEST_BL(0x6f543ca0, 0xa3afbfd0, 0x6f543ca0, 0xa3afbfd0)
    TEST_BL(0xe415ada8, 0xbf884e60, 0xe415ada8, 0xbf884e60)
    TEST_BL(0x0b96ab22, 0xc0d6f7c4, 0x0b96ab22, 0xc0d6f7c4)
    TEST_BL(0x5ae28f04, 0xf13ea9c0, 0x5ae28f04, 0xf13ea9c0)
    TEST_BL(0x2a34a7e4, 0xcbaf7220, 0x2a34a7e4, 0xcbaf7220)
    TEST_BL(0xd0ad4298, 0xf331669e, 0xd0ad4298, 0xf331669e)
    TEST_BL(0xa0666600, 0xd2dbb338, 0xa0666600, 0xd2dbb338)
    TEST_BL(0x78bc78cc, 0x5b6016a0, 0x78bc78cc, 0x5b6016a0)
    TEST_BL(0xe7050f78, 0x39d5936c, 0xe7050f78, 0x39d5936c)
    TEST_BL(0x19918b5e, 0x4434cce4, 0x19918b5e, 0x4434cce4)
    TEST_BL(0xfb6658fc, 0x55f6c180, 0xfb6658fc, 0x55f6c180)
    TEST_BL(0x5c597442, 0x97069b95, 0x5c597442, 0x97069b95)
    TEST_BL(0x40641bb4, 0xa4a7e410, 0x40641bb4, 0xa4a7e410)
    TEST_BL(0xa6f177e0, 0x6297679f, 0xa6f177e0, 0x6297679f)
    TEST_BL(0xde4805a8, 0x831d0fe8, 0xde4805a8, 0x831d0fe8)
    TEST_BL(0xd71129d0, 0x07e1fff8, 0xd71129d0, 0x07e1fff8)
    TEST_BL(0xa57eea80, 0xead68300, 0xa57eea80, 0xead68300)
    TEST_BL(0x8c126738, 0x729c97f4, 0x8c126738, 0x729c97f4)
    TEST_BL(0xc2f019bc, 0xa123d420, 0xc2f019bc, 0xa123d420)
    TEST_BL(0x4e60cfa6, 0xdf8b1860, 0x4e60cfa6, 0xdf8b1860)
    TEST_BL(0x88977aa0, 0xdd38d0b8, 0x88977aa0, 0xdd38d0b8)
    TEST_BL(0x8273a980, 0x15daba38, 0x8273a980, 0x15daba38)
    TEST_BL(0x2e33290a, 0xd9346c82, 0x2e33290a, 0xd9346c82)
    TEST_BL(0x864e94e4, 0xa20d82e4, 0x864e94e4, 0xa20d82e4)
    TEST_BL(0x63677728, 0x3d83ac49, 0x63677728, 0x3d83ac49)
    TEST_BL(0xdc9e95bc, 0x80890af0, 0xdc9e95bc, 0x80890af0)
    TEST_BL(0x62987b70, 0xb80855ae, 0x62987b70, 0xb80855ae)
    TEST_BL(0xb5b70534, 0x6507ff98, 0xb5b70534, 0x6507ff98)
    TEST_BL(0xac72d980, 0xbf989ac0, 0xac72d980, 0xbf989ac0)
    TEST_BL(0xf330e230, 0x3e8946c8, 0xf330e230, 0x3e8946c8)
    TEST_BL(0xa6d166cc, 0xe1821d9f, 0xa6d166cc, 0xe1821d9f)
    TEST_BL(0xf2a1547c, 0x27507968, 0xf2a1547c, 0x27507968)
    TEST_BL(0x22da9500, 0x3567c320, 0x22da9500, 0x3567c320)
    TEST_BL(0x456843ac, 0x9078aa46, 0x456843ac, 0x9078aa46)
    TEST_BL(0xf6374800, 0xfec9001c, 0xf6374800, 0xfec9001c)
    TEST_BL(0x7772970e, 0x5c93caaf, 0x7772970e, 0x5c93caaf)
    TEST_BL(0xd0deecae, 0x9242f92c, 0xd0deecae, 0x9242f92c)
    TEST_BL(0xf706e3d4, 0xd80065c8, 0xf706e3d4, 0xd80065c8)
    TEST_BL(0x88ed1d00, 0x01132628, 0x88ed1d00, 0x01132628)
    TEST_BL(0xf1d6dafe, 0xf8edf824, 0xf1d6dafe, 0xf8edf824)
    TEST_BL(0x65394174, 0xcc264320, 0x65394174, 0xcc264320)
    TEST_BL(0x7f95e490, 0xb64262d0, 0x7f95e490, 0xb64262d0)
    TEST_BL(0xe67c8576, 0x14fc505c, 0xe67c8576, 0x14fc505c)
    TEST_BL(0x54be7440, 0xf66c762e, 0x54be7440, 0xf66c762e)
    TEST_BL(0xd7a7e4e6, 0xcab5f8fb, 0xd7a7e4e6, 0xcab5f8fb)
    TEST_BL(0x626c7a3b, 0xc2279a00, 0x626c7a3b, 0xc2279a00)
    TEST_BL(0xd058ca5d, 0x87033d19, 0xd058ca5d, 0x87033d19)
    TEST_BL(0x4883255a, 0x527231d0, 0x4883255a, 0x527231d0)
    TEST_BL(0x482d4ba0, 0x166fe362, 0x482d4ba0, 0x166fe362)
    TEST_BL(0xaa8af5cc, 0x12fdc654, 0xaa8af5cc, 0x12fdc654)
    TEST_BL(0x60c6b2c4, 0x6d83e80a, 0x60c6b2c4, 0x6d83e80a)
    TEST_BL(0x86479cb8, 0xb78fb7a2, 0x86479cb8, 0xb78fb7a2)
    TEST_BL(0xab6b767c, 0x3de37136, 0xab6b767c, 0x3de37136)
    TEST_BL(0x4f2c6700, 0x5c6e1608, 0x4f2c6700, 0x5c6e1608)
    TEST_BL(0x837221e0, 0xf67a1882, 0x837221e0, 0xf67a1882)
    TEST_BL(0xe8609af3, 0xe8c6d23c, 0xe8609af3, 0xe8c6d23c)
    TEST_BL(0x397df8e2, 0xdad4d9c8, 0x397df8e2, 0xdad4d9c8)
    TEST_BL(0x50a379d0, 0xcebec140, 0x50a379d0, 0xcebec140)
    TEST_BL(0x3af9c4d7, 0x9d770cfe, 0x3af9c4d7, 0x9d770cfe)
    TEST_BL(0xe0814d80, 0x535d93c0, 0xe0814d80, 0x535d93c0)
    TEST_BL(0x9886e010, 0x300135f0, 0x9886e010, 0x300135f0)
    TEST_BL(0x70f4bbd4, 0x0afa6080, 0x70f4bbd4, 0x0afa6080)
    TEST_BL(0x957d3bd2, 0x5726030a, 0x957d3bd2, 0x5726030a)
    TEST_BL(0xff441412, 0x93520ef6, 0xff441412, 0x93520ef6)
    TEST_BL(0xa3ad1eca, 0x0f86f200, 0xa3ad1eca, 0x0f86f200)
    TEST_BL(0xe6bd89c0, 0x01dc0560, 0xe6bd89c0, 0x01dc0560)
    TEST_BL(0xf5e4174e, 0xbefbf528, 0xf5e4174e, 0xbefbf528)
    TEST_BL(0x0e2e04b8, 0x5e3ad5e9, 0x0e2e04b8, 0x5e3ad5e9)
    TEST_BL(0xf0132abc, 0x6a99fa90, 0xf0132abc, 0x6a99fa90)
    TEST_BL(0xd29b6d80, 0x5fde970c, 0xd29b6d80, 0x5fde970c)
    TEST_BL(0xb35fc4b0, 0x0b665f50, 0xb35fc4b0, 0x0b665f50)
    TEST_BL(0x8f73c708, 0x60315db8, 0x8f73c708, 0x60315db8)
    TEST_BL(0x148c1328, 0xb37f2bf5, 0x148c1328, 0xb37f2bf5)
    TEST_BL(0x7731562a, 0xb0d0928d, 0x7731562a, 0xb0d0928d)
    TEST_BL(0xe8469a78, 0xf1e42cc0, 0xe8469a78, 0xf1e42cc0)
    TEST_BL(0x872f83e8, 0x9e525fe0, 0x872f83e8, 0x9e525fe0)
    TEST_BL(0xca114c7f, 0xd1613e14, 0xca114c7f, 0xd1613e14)
    TEST_BL(0x1f771c40, 0x5c131564, 0x1f771c40, 0x5c131564)
    TEST_BL(0x59892de4, 0x7c4d6241, 0x59892de4, 0x7c4d6241)
    TEST_BL(0x762014e5, 0xb748edf0, 0x762014e5, 0xb748edf0)
    TEST_BL(0x0630a598, 0xbf4fc5a0, 0x0630a598, 0xbf4fc5a0)
    TEST_BL(0x3d40efc0, 0xedfb0588, 0x3d40efc0, 0xedfb0588)
    TEST_BL(0xf36d1638, 0x04b484c0, 0xf36d1638, 0x04b484c0)
    TEST_BL(0xaf105dfc, 0xa7ba2b5c, 0xaf105dfc, 0xa7ba2b5c)
    TEST_BL(0x443323f8, 0xf9a5cf25, 0x443323f8, 0xf9a5cf25)
    TEST_BL(0x958083cc, 0x7abfbd64, 0x958083cc, 0x7abfbd64)
    TEST_BL(0x0849c579, 0x494076ef, 0x0849c579, 0x494076ef)
    TEST_BL(0x0c3d52a0, 0x095f1c90, 0x0c3d52a0, 0x095f1c90)
    TEST_BL(0x7869bfbc, 0x5b92ccac, 0x7869bfbc, 0x5b92ccac)
    TEST_BL(0xc45cefa4, 0x7006ab64, 0xc45cefa4, 0x7006ab64)
    TEST_BL(0x9641dae6, 0x21bd0b07, 0x9641dae6, 0x21bd0b07)
    TEST_BL(0x4cd7ccef, 0xb838965b, 0x4cd7ccef, 0xb838965b)
    TEST_BL(0xd924322a, 0x9ebbb9dc, 0xd924322a, 0x9ebbb9dc)
    TEST_BL(0xb9080a70, 0xcffad758, 0xb9080a70, 0xcffad758)
    TEST_BL(0x53a61c51, 0xd9776eae, 0x53a61c51, 0xd9776eae)
    TEST_BL(0xa2afbf34, 0x47562800, 0xa2afbf34, 0x47562800)
    TEST_BL(0x5edf2815, 0x09654c40, 0x5edf2815, 0x09654c40)
    TEST_BL(0x18fd52d0, 0x83ff1689, 0x18fd52d0, 0x83ff1689)
    TEST_BL(0xc18668c2, 0xec028728, 0xc18668c2, 0xec028728)
    TEST_BL(0x6cc55230, 0x9a0af75e, 0x6cc55230, 0x9a0af75e)
    TEST_BL(0xf5aaab48, 0xd1b0328c, 0xf5aaab48, 0xd1b0328c)
    TEST_BL(0xf3ff4eac, 0xce6aecb3, 0xf3ff4eac, 0xce6aecb3)
    TEST_BL(0x0947cf11, 0x2c07ace8, 0x0947cf11, 0x2c07ace8)
    TEST_BL(0x5eaec54e, 0x94d512f8, 0x5eaec54e, 0x94d512f8)
    TEST_BL(0xa07b8e00, 0xddfdbc60, 0xa07b8e00, 0xddfdbc60)
    TEST_BL(0xcf09fb60, 0x23296371, 0xcf09fb60, 0x23296371)
    TEST_BL(0x00cda400, 0x526632b0, 0x00cda400, 0x526632b0)
    TEST_BL(0xf2367e0c, 0xdb2154f8, 0xf2367e0c, 0xdb2154f8)
    TEST_BL(0x5b73db50, 0x23c55346, 0x5b73db50, 0x23c55346)
    TEST_BL(0x99393820, 0xb3472a6c, 0x99393820, 0xb3472a6c)
    TEST_BL(0xca33c824, 0x38659bc8, 0xca33c824, 0x38659bc8)
    TEST_BL(0x3d8d2c44, 0xe6595cd2, 0x3d8d2c44, 0xe6595cd2)
    TEST_BL(0x9db739aa, 0x940d49fe, 0x9db739aa, 0x940d49fe)
    TEST_BL(0x34af7570, 0x30a1f5c4, 0x34af7570, 0x30a1f5c4)
    TEST_BL(0x2d1b57d7, 0x559e4a76, 0x2d1b57d7, 0x559e4a76)
    TEST_BL(0xa424d030, 0x4a029754, 0xa424d030, 0x4a029754)
    TEST_BL(0xf5f1fea0, 0x17c22c9e, 0xf5f1fea0, 0x17c22c9e)
    TEST_BL(0xc2e26918, 0x555e1066, 0xc2e26918, 0x555e1066)
    TEST_BL(0x2eb1d6d6, 0x0f003580, 0x2eb1d6d6, 0x0f003580)
    TEST_BL(0x32eae280, 0x174f4580, 0x32eae280, 0x174f4580)
    TEST_BL(0x824c9710, 0xb2d3fe09, 0x824c9710, 0xb2d3fe09)
    TEST_BL(0xf41338d8, 0x7d527120, 0xf41338d8, 0x7d527120)
    TEST_BL(0x2ff13590, 0xe51179de, 0x2ff13590, 0xe51179de)
    TEST_BL(0x6310dd60, 0x9423fac0, 0x6310dd60, 0x9423fac0)
    TEST_BL(0x9f434002, 0x775d06fc, 0x9f434002, 0x775d06fc)
    TEST_BL(0x49b9c1c0, 0xa4a1f200, 0x49b9c1c0, 0xa4a1f200)
    TEST_BL(0x52eafe00, 0xfaddf60c, 0x52eafe00, 0xfaddf60c)
    TEST_BL(0xd280ee0a, 0x2176f4c0, 0xd280ee0a, 0x2176f4c0)
    TEST_BL(0xe9bc5a90, 0xab0421a6, 0xe9bc5a90, 0xab0421a6)
    TEST_BL(0x8335d66d, 0xdaf2c222, 0x8335d66d, 0xdaf2c222)
    TEST_BL(0x18e08d00, 0x6fa3619e, 0x18e08d00, 0x6fa3619e)
###detect exception
    bne s2, zero, inst_error
    nop
###score ++
    addi.w s3, s3, 1
###output (s0<<24)|s3
inst_error:  
    slli.w t1, s0, 24
    NOP4
    or t0, t1, s3 
    NOP4
    st.w t0, s1, 0
    jirl zero, ra, 0
    nop
END(n18_bl_test)
